﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IMainUI.cs" company="Scrum for Team System">
//   None
// </copyright>
// <summary>
//   Defines the IMainUI type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace ScrumForTeamSystem.Setup.SfTSConfigatorUI
{
    using System;
    using System.Collections.Generic;

    using SfTSDeployment;

    /// <summary>
    /// Defines the main ui interface.
    /// </summary>
    public interface IMainUI
    {
        /// <summary>
        /// Occurs when [selected collection changed].
        /// </summary>
        event EventHandler SelectedCollectionChanged;

        /// <summary>
        /// Occurs when [load collections].
        /// </summary>
        event EventHandler ListCollections;

        /// <summary>
        /// Occurs when [deploy].
        /// </summary>
        event EventHandler Deploy;

        /// <summary>
        /// Occurs when [retract].
        /// </summary>
        event EventHandler Retract;

        /// <summary>
        /// Occurs when [subscribe].
        /// </summary>
        event EventHandler Subscribe;

        /// <summary>
        /// Occurs when [unsubscribe].
        /// </summary>
        event EventHandler Unsubscribe;

        /// <summary>
        /// Gets or sets the TFS URL.
        /// </summary>
        /// <value>The TFS URL.</value>
        string TfsUrl { get; set; }

        /// <summary>
        /// Gets or sets the meta data file path.
        /// </summary>
        /// <value>The meta data file path.</value>
        string MetaDataFilePath { get; set; }

        /// <summary>
        /// Gets or sets the zip file path.
        /// </summary>
        /// <value>The zip file path.</value>
        string ZipFilePath { get; set; }

        /// <summary>
        /// Gets the selected project collection.
        /// </summary>
        /// <value>The selected project collection.</value>
        string SelectedCollectionName { get; }

        /// <summary>
        /// Sets the templates.
        /// </summary>
        /// <param name="templates">The templates.</param>
        void SetTemplateList(IEnumerable<TemplateInfo> templates);

        /// <summary>
        /// Sets the subscriptions.
        /// </summary>
        /// <param name="subscriptions">The subscriptions.</param>
        void SetSubscriptionList(IEnumerable<SubscriptionInfo> subscriptions);

        /// <summary>
        /// Sets the collections.
        /// </summary>
        /// <param name="collections">The collections.</param>
        void SetCollectionList(IEnumerable<ProjectCollectionInfo> collections);

        /// <summary>
        /// Enables ui interation.
        /// </summary>
        /// <param name="isAllowed">if set to <c>true</c> [is allowed].</param>
        void EnableUIInteration(bool isAllowed);

        /// <summary>
        /// Sets the status.
        /// </summary>
        /// <param name="message">The message.</param>
        void SetStatus(string message);

        /// <summary>
        /// Sets the exception status.
        /// </summary>
        /// <param name="exceptions">The exceptions.</param>
        void SetStatus(Exception exceptions);

        /// <summary>
        /// Determines whether this instance can deploy the template to the selected collection.
        /// </summary>
        /// <param name="isAllowed">if set to <c>true</c> [is allowed].</param>
        void CanDeploy(bool isAllowed);

        /// <summary>
        /// Determines whether this instance can retract the template from the selected collection.
        /// </summary>
        /// <param name="isAllowed">if set to <c>true</c> [is allowed].</param>
        void CanRetract(bool isAllowed);

        /// <summary>
        /// Determines whether this instance can add a subscription.
        /// </summary>
        /// <param name="isAllowed">if set to <c>true</c> [is allowed].</param>
        void CanSubscribe(bool isAllowed);

        /// <summary>
        /// Determines whether this instance can unsubscribe.
        /// </summary>
        /// <param name="isAllowed">if set to <c>true</c> if [is allowed].</param>
        void CanUnsubscribe(bool isAllowed);
    }
}
